package com.zy.design.dd.abs;

import com.zy.design.dd.entity.ActionEnum;
import com.zy.design.dd.entity.CountData;
import com.zy.design.dd.entity.DataLine;

/**
 * @author zhaoyi
 * @date 2021/3/19 13:30
 * 空驶时长计算
 */
public class EmptyCountHandler implements CountHandler {


    @Override
    public void count(DataLine dataLine, CountData countData) {
        if (dataLine.getAction().equals(ActionEnum.EMPTY)){
            System.out.println("为空驶");
            countData.setEmptyTime(dataLine.getEndTime()-dataLine.getStartTime());
        }

    }
}
